/***********************************************
 This file is part of redia-bapps-main-ios.
 
 Copyright (c) 2015 Redia A/S
 
 Redia-bapps-main-ios is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.
 
 Redia-bapps-main-ios is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with redia-bapps-main-ios.  If not, see <http://www.gnu.org/licenses/>.
 
 *********************************************** */

//
//  BALightFrameButton.m
//  redia-bapps-ios
//
//  Created by Henrik Lynbech on 11/08/13.
//  Copyright (c) 2013 redia. All rights reserved.
//

#import "BALightFrameButton.h"
#import <QuartzCore/QuartzCore.h>
#import "BAUtils.h"

@implementation BALightFrameButton

-(void)commonBALightFrameButtonInit
{
    BA_LABEL_SET_FONT_REGULAR(self.titleLabel)

    self.borderNormalColor = [UIColor colorWithWhite:209.0/255.0 alpha:1];
    self.borderHighlightColor = self.borderNormalColor;
    self.borderSelectedColor = self.borderNormalColor;
    
    
    self.layer.borderWidth = 1;
    self.layer.cornerRadius = 2;

}

-(id)init
{
    self = [super init];
    if (self) {
        // Initialization code
        [self commonBALightFrameButtonInit];
    }
    return self;
}

-(id)initWithCoder:(NSCoder *)aDecoder{
    self = [super initWithCoder:aDecoder];
    if (self) {
        // Initialization code
        [self commonBALightFrameButtonInit];
    }
    return self;
}

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code
        [self commonBALightFrameButtonInit];
    }
    return self;
}

-(void)awakeFromNib
{
    if ([self.backgroundColor isEqual:[UIColor clearColor]] || self.backgroundColor==nil) {
        self.highlightColor = [UIColor colorWithWhite:0 alpha:0.15];
    } else {
        self.highlightColor = [self.backgroundColor colorWithAlphaComponent:0.85];
    }
    
    [super awakeFromNib];
    
    
    
}

@end
